package com.ruoyi.system.domain;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.*;

public class SysStatisticsDetails implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 数据id 备用缓存
     */
    private String statisticsId;
    /**
     * 数据总数
     */
    private Integer statisticsTotal;
    /**
     * 列表图标返回
     */
    private MyListResult listResult;

    /**
     * 关键指数
     */
    private MySpecialResult specialResult;

    /**
     * 普通指数
     */
    private MyCommonResult commonResult;

    /**
     * init参数
     */
    private Object initParams;


    public MySpecialResult getSpecialResult() {
        return specialResult;
    }

    public void setSpecialResult(MySpecialResult specialResult) {
        this.specialResult = specialResult;
    }

    public MyCommonResult getCommonResult() {
        return commonResult;
    }

    public void setCommonResult(MyCommonResult commonResult) {
        this.commonResult = commonResult;
    }

    public MyListResult getListResult() {
        return listResult;
    }

    public void setListResult(MyListResult listResult) {
        this.listResult = listResult;
    }

    public String getStatisticsId() {
        return statisticsId;
    }

    public void setStatisticsId(String statisticsId) {
        this.statisticsId = statisticsId;
    }

    public Integer getStatisticsTotal() {
        return statisticsTotal;
    }

    public void setStatisticsTotal(Integer statisticsTotal) {
        this.statisticsTotal = statisticsTotal;
    }

    public Object getInitParams() {
        return initParams;
    }

    public void setInitParams(Object initParams) {
        this.initParams = initParams;
    }


    public SysStatisticsDetails() {
    }

    //获取时间 日差
    public int getDayOfData1ReduceData2(Date d1, Date d2) {
        long from = d1.getTime();
        long to = d2.getTime();
        return (int) ((to - from) / (1000 * 60 * 60 * 24));
    }

    // 初始化数据 根据列表来完善统计数据
    public SysStatisticsDetails(String data_2, List<SysFaultPms> list, Date time1, Date time2, HashMap params) {
        this.statisticsId = data_2;
        this.statisticsTotal = 0;
        this.specialResult = new MySpecialResult();
        this.commonResult = new MyCommonResult();
        this.listResult = new MyListResult();
        this.valueChange(list, time1, time2, params);
    }

    // 输入时间列表  更新数据
    private void valueChange(List<SysFaultPms> list, Date time1, Date time2, HashMap params) {
        ArrayList<Integer> wxqLs = new ArrayList<Integer>();
        ArrayList<Integer> yxqLs = new ArrayList<Integer>();
        HashMap supplierTotal = new HashMap<>();
        HashMap substationTotal = new HashMap<>();
        HashMap sourceTotal = new HashMap<>();
        HashMap voltageLevelTotal = new HashMap<>();
        HashMap groupTotal = new HashMap<>();
        HashMap faultTyTotal = new HashMap<>();
        HashMap degreeTotal = new HashMap<>();
        HashMap isSolveTotal = new HashMap<>();
        HashMap cycleTotal = new HashMap<>();
        HashMap reYearDeviceTotal = new HashMap<>();

        for (SysFaultPms sysFault : list) {

            //判断 数据是否需要统计
            // 排除 来源 电压等级 班组 缺陷类型 缺陷性质
            if (!this.getParamsResult(params, sysFault)) {
                continue;
            }
            // 排除 是否消缺
            if (sysFault.getOverTime() == null) {
                String key = "未消缺";
                if (params.containsKey(key)) {
                    continue;
                }
            } else {
                if (sysFault.getOverTime().compareTo(time2) > 0) {
                    String key = "未消缺";
                    if (params.containsKey(key)) {
                        continue;
                    }
                } else {
                    String key = "已消缺";
                    if (params.containsKey(key)) {
                        continue;
                    }
                }
            }

            // 排除 周期内外
            // compareTo()方法的返回值，date1小于date2返回-1，date1大于date2返回1，相等返回0
            //发现时间大于等于 起始时间（time1）
            if (sysFault.getStartTime().compareTo(time1) < 0) {
                //历史缺陷
                String key = "周期外缺陷";
                if (params.containsKey(key)) {
                    continue;
                }

                Integer val = 1;
                if (cycleTotal.containsKey(key)) {
                    val = (Integer) cycleTotal.get(key) + 1;
                }
                cycleTotal.put(key, val);
            } else {
                //本月缺陷
                String key = "周期内缺陷";
                if (params.containsKey(key)) {
                    continue;
                }

                Integer val = 1;
                if (cycleTotal.containsKey(key)) {
                    val = (Integer) cycleTotal.get(key) + 1;
                }
                cycleTotal.put(key, val);
            }

            //是否消缺统计
            if (sysFault.getOverTime() == null) {
                String key = "未消缺";
                Integer val = 1;
                if (isSolveTotal.containsKey(key)) {
                    val = (Integer) isSolveTotal.get(key) + 1;
                }
                isSolveTotal.put(key, val);
                //计算当前缺陷 未消缺的时长  结束时间以 time2为标准
                int days = this.getDayOfData1ReduceData2(sysFault.getStartTime(), time2);
                wxqLs.add(days);
                //保存计算后的时间
                key = "未消缺--平均天数";
                Double avg = wxqLs.stream().mapToInt(Integer::intValue).average().getAsDouble();
                isSolveTotal.put(key, avg.intValue());
                //记录最大值
                key = "未消缺--最大天数";
                int max = Collections.max(wxqLs);
                isSolveTotal.put(key, max);
                //记录最小值
                key = "未消缺--最小天数";
                int min = Collections.min(wxqLs);
                isSolveTotal.put(key, min);
            } else {
                String key;
                Integer val = 1;
                // compareTo()方法的返回值，date1小于date2返回-1，date1大于date2返回1，相等返回0
                // 消缺时间大于截至时间(time2) 属于 未消缺
                if (sysFault.getOverTime().compareTo(time2) > 0) {
                    //计算当前缺陷 未消缺的时长  结束时间以 time2为标准
                    int days = this.getDayOfData1ReduceData2(sysFault.getStartTime(), time2);
                    wxqLs.add(days);
                    //保存计算后的时间
                    key = "未消缺--平均天数";
                    Double avg = wxqLs.stream().mapToInt(Integer::intValue).average().getAsDouble();
                    isSolveTotal.put(key, avg.intValue());
                    //记录最大值
                    key = "未消缺--最大天数";
                    int max = Collections.max(wxqLs);
                    isSolveTotal.put(key, max);
                    //记录最小值
                    key = "未消缺--最小天数";
                    int min = Collections.min(wxqLs);
                    isSolveTotal.put(key, min);
                    key = "未消缺";
                } else {
                    //计算当前缺陷 未消缺的时长  结束时间以 以overtime为标准
                    int days = this.getDayOfData1ReduceData2(sysFault.getStartTime(), sysFault.getOverTime());
                    yxqLs.add(days);
                    //保存计算后的时间
                    key = "已消缺--平均天数";
                    Double avg = yxqLs.stream().mapToInt(Integer::intValue).average().getAsDouble();
                    isSolveTotal.put(key, avg.intValue());
                    //记录最大值
                    key = "已消缺--最大天数";
                    int max = Collections.max(yxqLs);
                    isSolveTotal.put(key, max);
                    //记录最小值
                    key = "已消缺--最小天数";
                    int min = Collections.min(yxqLs);
                    isSolveTotal.put(key, min);
                    key = "已消缺";
                }
                if (isSolveTotal.containsKey(key)) {
                    val = (Integer) isSolveTotal.get(key) + 1;
                }
                isSolveTotal.put(key, val);
            }


            // 记录缺陷设备投年运曲线
            if (sysFault.getBeginRunTime() != null) {
                SimpleDateFormat formatter = new SimpleDateFormat("yyyy");
                String key = formatter.format(sysFault.getBeginRunTime());
                Integer val = 1;
                if (reYearDeviceTotal.containsKey(key)) {
                    val = (Integer) reYearDeviceTotal.get(key) + 1;
                }
                reYearDeviceTotal.put(key, val);
            }

            //缺陷性质统计
            if (!sysFault.getFaultDegree().equals("")) {
                String key = sysFault.getFaultDegree();
                Integer val = 1;
                if (degreeTotal.containsKey(key)) {
                    val = (Integer) degreeTotal.get(key) + 1;
                }
                degreeTotal.put(key, val);
            }

            //设备类型
            if (!sysFault.getFaultTy().equals("")) {
                String key = sysFault.getFaultTy();
                Integer val = 1;
                if (faultTyTotal.containsKey(key)) {
                    val = (Integer) faultTyTotal.get(key) + 1;
                }
                faultTyTotal.put(key, val);
            } else {
                String key = "未设置类型";
                Integer val = 1;
                if (faultTyTotal.containsKey(key)) {
                    val = (Integer) faultTyTotal.get(key) + 1;
                }
                faultTyTotal.put(key, val);
            }

            //统计班组
            if (!sysFault.getFaultGroup().equals("")) {
                String key = sysFault.getFaultGroup();
                Integer val = 1;
                if (groupTotal.containsKey(key)) {
                    val = (Integer) groupTotal.get(key) + 1;
                }
                groupTotal.put(key, val);
            }

            //电压等级统计
            if (!sysFault.getVoltageLevel().equals("")) {
                String key = sysFault.getVoltageLevel();
                Integer val = 1;
                if (voltageLevelTotal.containsKey(key)) {
                    val = (Integer) voltageLevelTotal.get(key) + 1;
                }
                voltageLevelTotal.put(key, val);
            } else {
                String key = "无电压等级";
                Integer val = 1;
                if (voltageLevelTotal.containsKey(key)) {
                    val = (Integer) voltageLevelTotal.get(key) + 1;
                }
                voltageLevelTotal.put(key, val);
            }

            //来源统计
            if (!sysFault.getFaultSource().equals("")) {
                String key = sysFault.getFaultSource();
                Integer val = 1;
                if (key.equals("管控")) {
                    key = "管控系统";
                }
                if (sourceTotal.containsKey(key)) {
                    val = (Integer) sourceTotal.get(key) + 1;
                }
                sourceTotal.put(key, val);
            }

            //变电站统计
            if (!sysFault.getSubstationName().equals("")) {
                String key = sysFault.getSubstationName();
                Integer val = 1;
                if (substationTotal.containsKey(key)) {
                    val = (Integer) substationTotal.get(key) + 1;
                }
                substationTotal.put(key, val);
            }

            //供应商统计
            if (!sysFault.getSupplierName().equals("")) {
                String key = sysFault.getSupplierName();
                Integer val = 1;
                if (supplierTotal.containsKey(key)) {
                    val = (Integer) supplierTotal.get(key) + 1;
                }
                supplierTotal.put(key, val);
            } else {
                //供应商不存在的统计
                String key = "没有供应商信息";
                Integer val = 1;
                if (supplierTotal.containsKey(key)) {
                    val = (Integer) supplierTotal.get(key) + 1;
                }
                supplierTotal.put(key, val);
            }
            // 缺陷设备 投运时间图
            this.statisticsTotal += 1;
        }

        this.sortProperty(voltageLevelTotal, isSolveTotal, cycleTotal, degreeTotal, groupTotal,
                sourceTotal, faultTyTotal, supplierTotal, substationTotal, reYearDeviceTotal);

    }

    // 排除 来源 电压等级 班组 缺陷类型 缺陷性质
    public boolean getParamsResult(HashMap params, SysFaultPms sysFaultPms) {
        String faultSource = sysFaultPms.getFaultSource();
        if (params.containsKey(faultSource)) {
            return false;
        }
        String voltageLevel = sysFaultPms.getVoltageLevel();
        if (params.containsKey(voltageLevel)) {
            return false;
        }
        String faultGroup = sysFaultPms.getFaultGroup();
        if (params.containsKey(faultGroup)) {
            return false;
        }
        String faultTy = sysFaultPms.getFaultTy();
        if (params.containsKey(faultTy)) {
            return false;
        }
        String faultDegree = sysFaultPms.getFaultDegree();
        if (params.containsKey(faultDegree)) {
            return false;
        }
        return true;
    }

    // 数据排序 构建数据对象
    public void sortProperty(HashMap voltageLevelTotal, HashMap isSolveTotal, HashMap cycleTotal, HashMap degreeTotal, HashMap groupTotal,
                             HashMap sourceTotal, HashMap faultTyTotal, HashMap supplierTotal, HashMap substationTotal, HashMap reYearDeviceTotal) {
        //关键指标获取
        if (cycleTotal.containsKey("周期内缺陷")) {
            this.specialResult.setCycleIn((Integer) cycleTotal.get("周期内缺陷"));
        }
        if (cycleTotal.containsKey("周期外缺陷")) {
            this.specialResult.setCycleOut((Integer) cycleTotal.get("周期外缺陷"));
        }
        if (isSolveTotal.containsKey("已消缺")) {
            this.specialResult.setIsSolve((Integer) isSolveTotal.get("已消缺"));
        }
        if (isSolveTotal.containsKey("未消缺")) {
            this.specialResult.setNoSolve((Integer) isSolveTotal.get("未消缺"));
        }
        if (degreeTotal.containsKey("一般")) {
            this.specialResult.setDegreeCommonly((Integer) degreeTotal.get("一般"));
        }
        if (degreeTotal.containsKey("严重")) {
            this.specialResult.setDegreeSerious((Integer) degreeTotal.get("严重"));
        }
        if (degreeTotal.containsKey("危急")) {
            this.specialResult.setDegreeCritical((Integer) degreeTotal.get("危急"));
        }
        if (sourceTotal.containsKey("PMS")) {
            this.specialResult.setSourcePms((Integer) sourceTotal.get("PMS"));
        }
        if (sourceTotal.containsKey("管控系统")) {
            this.specialResult.setSourceManager((Integer) sourceTotal.get("管控系统"));
        }

        if (groupTotal.containsKey("熊家嘴运维班")) {
            this.specialResult.setGroupXjz((Integer) groupTotal.get("熊家嘴运维班"));
        }
        if (groupTotal.containsKey("汈东运维班")) {
            this.specialResult.setGroupDd((Integer) groupTotal.get("汈东运维班"));
        }
        if (groupTotal.containsKey("红石坡运维班")) {
            this.specialResult.setGroupHsp((Integer) groupTotal.get("红石坡运维班"));
        }
        if (groupTotal.containsKey("梦泽运维班")) {
            this.specialResult.setGroupMz((Integer) groupTotal.get("梦泽运维班"));
        }
        if (groupTotal.containsKey("彭湾运维班")) {
            this.specialResult.setGroupPw((Integer) groupTotal.get("彭湾运维班"));
        }
        if (groupTotal.containsKey("姚家冲运维班")) {
            this.specialResult.setGroupYjc((Integer) groupTotal.get("姚家冲运维班"));
        }
        if (groupTotal.containsKey("上庙运维班")) {
            this.specialResult.setGroupSm((Integer) groupTotal.get("上庙运维班"));
        }


        //普通指标
        if (isSolveTotal.containsKey("未消缺--平均天数")) {
            this.commonResult.setNoSolveAvg((Integer) isSolveTotal.get("未消缺--平均天数"));
        }
        if (isSolveTotal.containsKey("未消缺--最大天数")) {
            this.commonResult.setNoSolveMax((Integer) isSolveTotal.get("未消缺--最大天数"));
        }
        if (isSolveTotal.containsKey("未消缺--最小天数")) {
            this.commonResult.setNoSolveMin((Integer) isSolveTotal.get("未消缺--最小天数"));
        }
        if (isSolveTotal.containsKey("已消缺--平均天数")) {
            this.commonResult.setIsSolveAvg((Integer) isSolveTotal.get("已消缺--平均天数"));
        }
        if (isSolveTotal.containsKey("已消缺--最大天数")) {
            this.commonResult.setIsSolveMax((Integer) isSolveTotal.get("已消缺--最大天数"));
        }
        if (isSolveTotal.containsKey("已消缺--最小天数")) {
            this.commonResult.setIsSolveMin((Integer) isSolveTotal.get("已消缺--最小天数"));
        }

        this.commonResult.setSubstationTotal(substationTotal.size());
        this.commonResult.setSupplierTotal(supplierTotal.size());


        //图标列表
        ArrayList reYearList = new ArrayList<Map.Entry<String, Integer>>(reYearDeviceTotal.entrySet());
        ArrayList supplierList = new ArrayList<Map.Entry<String, Integer>>(supplierTotal.entrySet());
        ArrayList substationList = new ArrayList<Map.Entry<String, Integer>>(substationTotal.entrySet());
        ArrayList voltageLevList = new ArrayList<Map.Entry<String, Integer>>(voltageLevelTotal.entrySet());
        ArrayList faultTyList = new ArrayList<Map.Entry<String, Integer>>(faultTyTotal.entrySet());
        ArrayList degreeList = new ArrayList<Map.Entry<String, Integer>>(degreeTotal.entrySet());
        ArrayList groupList = new ArrayList<Map.Entry<String, Integer>>(groupTotal.entrySet());
        getKeySort(reYearList);
        getValSort(supplierList);
        getValSort(substationList);
        getValSort(voltageLevList);
        getValSort(faultTyList);
        getValSort(degreeList);
        getValSort(groupList);
        //设置列表数据
        this.listResult.setReYearList(getMyKvList(reYearList));
        this.listResult.setSupplierList(getMyKvList(supplierList));
        this.listResult.setSubstationList(getMyKvList(substationList));
        this.listResult.setVoltageLevList(getMyKvList(voltageLevList));
        this.listResult.setFaultTyList(getMyKvList(faultTyList));
        this.listResult.setDegreeList(getMyKvList(degreeList));
        this.listResult.setGroupList(getMyKvList(groupList));
    }

    public MyListKeyAndVal getMyKvList(ArrayList list) {

        List<String> keys = new ArrayList<>();
        List<Integer> vals = new ArrayList<>();
        for (Object o : list) {
            Map.Entry<String, Integer> m = (Map.Entry<String, Integer>) o;
            keys.add(m.getKey());
            vals.add(m.getValue());
        }
        MyListKeyAndVal kv = new MyListKeyAndVal(keys, vals);
        return kv;
    }


    public void getValSort(ArrayList list) {
        Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2) {
                return o2.getValue() - o1.getValue();
            }
        });
    }

    public void getKeySort(ArrayList list) {
        Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2) {
                return (o1.getKey()).toString().compareTo(o2.getKey().toString());
            }
        });
    }
}

//关键指标
class MySpecialResult implements Serializable {
    //数据来源
    private Integer sourcePms;//PMS
    private Integer sourceManager;//管控平台
    //缺陷性质
    private Integer degreeCommonly;//一般
    private Integer degreeSerious;//严重
    private Integer degreeCritical;//危急

    private Integer isSolve;//已处理
    private Integer noSolve;//未处理

    private Integer groupXjz;//熊家嘴运维班
    private Integer groupDd;//汈东运维班
    private Integer groupHsp;//红石坡运维班
    private Integer groupMz;//梦泽运维班
    private Integer groupPw;//彭湾运维班
    private Integer groupYjc;//姚家冲运维班
    private Integer groupSm;//上庙运维班

    private Integer cycleIn;//周期内
    private Integer cycleOut;//周期外

    public MySpecialResult() {
        this.sourcePms = 0;
        this.sourceManager = 0;

        this.degreeCommonly = 0;
        this.degreeSerious = 0;
        this.degreeCritical = 0;

        this.isSolve = 0;
        this.noSolve = 0;

        this.groupXjz = 0;
        this.groupDd = 0;
        this.groupHsp = 0;
        this.groupMz = 0;
        this.groupPw = 0;
        this.groupYjc = 0;
        this.groupSm = 0;

        this.cycleIn = 0;
        this.cycleOut = 0;
    }

    public Integer getSourcePms() {
        return sourcePms;
    }

    public void setSourcePms(Integer sourcePms) {
        this.sourcePms = sourcePms;
    }

    public Integer getSourceManager() {
        return sourceManager;
    }

    public void setSourceManager(Integer sourceManager) {
        this.sourceManager = sourceManager;
    }

    public Integer getDegreeCommonly() {
        return degreeCommonly;
    }

    public void setDegreeCommonly(Integer degreeCommonly) {
        this.degreeCommonly = degreeCommonly;
    }

    public Integer getDegreeSerious() {
        return degreeSerious;
    }

    public void setDegreeSerious(Integer degreeSerious) {
        this.degreeSerious = degreeSerious;
    }

    public Integer getDegreeCritical() {
        return degreeCritical;
    }

    public void setDegreeCritical(Integer degreeCritical) {
        this.degreeCritical = degreeCritical;
    }

    public Integer getIsSolve() {
        return isSolve;
    }

    public void setIsSolve(Integer isSolve) {
        this.isSolve = isSolve;
    }

    public Integer getNoSolve() {
        return noSolve;
    }

    public void setNoSolve(Integer noSolve) {
        this.noSolve = noSolve;
    }

    public Integer getGroupXjz() {
        return groupXjz;
    }

    public void setGroupXjz(Integer groupXjz) {
        this.groupXjz = groupXjz;
    }

    public Integer getGroupDd() {
        return groupDd;
    }

    public void setGroupDd(Integer groupDd) {
        this.groupDd = groupDd;
    }

    public Integer getGroupHsp() {
        return groupHsp;
    }

    public void setGroupHsp(Integer groupHsp) {
        this.groupHsp = groupHsp;
    }

    public Integer getGroupMz() {
        return groupMz;
    }

    public void setGroupMz(Integer groupMz) {
        this.groupMz = groupMz;
    }

    public Integer getGroupPw() {
        return groupPw;
    }

    public void setGroupPw(Integer groupPw) {
        this.groupPw = groupPw;
    }

    public Integer getGroupYjc() {
        return groupYjc;
    }

    public void setGroupYjc(Integer groupYjc) {
        this.groupYjc = groupYjc;
    }

    public Integer getGroupSm() {
        return groupSm;
    }

    public void setGroupSm(Integer groupSm) {
        this.groupSm = groupSm;
    }

    public Integer getCycleIn() {
        return cycleIn;
    }

    public void setCycleIn(Integer cycleIn) {
        this.cycleIn = cycleIn;
    }

    public Integer getCycleOut() {
        return cycleOut;
    }

    public void setCycleOut(Integer cycleOut) {
        this.cycleOut = cycleOut;
    }
}

class MyCommonResult implements Serializable {

    private Integer supplierTotal;

    private Integer substationTotal;

    //已消缺最大天数
    private Integer isSolveMax;

    //已消缺最小天数
    private Integer isSolveMin;

    //已消缺平均天数
    private Integer isSolveAvg;

    //未消缺最大天数
    private Integer noSolveMax;

    //未消缺最小天数
    private Integer noSolveMin;

    //未消缺平均天数
    private Integer noSolveAvg;

    public MyCommonResult() {
        this.isSolveMax = 0;
        this.isSolveMin = 0;
        this.isSolveAvg = 0;
        this.noSolveMax = 0;
        this.noSolveMin = 0;
        this.noSolveAvg = 0;
    }

    public Integer getSupplierTotal() {
        return supplierTotal;
    }

    public void setSupplierTotal(Integer supplierTotal) {
        this.supplierTotal = supplierTotal;
    }

    public Integer getSubstationTotal() {
        return substationTotal;
    }

    public void setSubstationTotal(Integer substationTotal) {
        this.substationTotal = substationTotal;
    }

    public Integer getIsSolveMax() {
        return isSolveMax;
    }

    public void setIsSolveMax(Integer isSolveMax) {
        this.isSolveMax = isSolveMax;
    }

    public Integer getIsSolveMin() {
        return isSolveMin;
    }

    public void setIsSolveMin(Integer isSolveMin) {
        this.isSolveMin = isSolveMin;
    }

    public Integer getIsSolveAvg() {
        return isSolveAvg;
    }

    public void setIsSolveAvg(Integer isSolveAvg) {
        this.isSolveAvg = isSolveAvg;
    }

    public Integer getNoSolveMax() {
        return noSolveMax;
    }

    public void setNoSolveMax(Integer noSolveMax) {
        this.noSolveMax = noSolveMax;
    }

    public Integer getNoSolveMin() {
        return noSolveMin;
    }

    public void setNoSolveMin(Integer noSolveMin) {
        this.noSolveMin = noSolveMin;
    }

    public Integer getNoSolveAvg() {
        return noSolveAvg;
    }

    public void setNoSolveAvg(Integer noSolveAvg) {
        this.noSolveAvg = noSolveAvg;
    }

}

// 图标列表
class MyListResult implements Serializable {

    private MyListKeyAndVal reYearList;
    private MyListKeyAndVal supplierList;
    private MyListKeyAndVal substationList;
    private MyListKeyAndVal voltageLevList;
    private MyListKeyAndVal faultTyList;
    private MyListKeyAndVal degreeList;
    private MyListKeyAndVal groupList;

    public MyListResult() {
    }

    public MyListResult(MyListKeyAndVal reYearList, MyListKeyAndVal supplierList, MyListKeyAndVal substationList, MyListKeyAndVal voltageLevList, MyListKeyAndVal faultTyList, MyListKeyAndVal degreeList, MyListKeyAndVal groupList) {
        this.reYearList = reYearList;
        this.supplierList = supplierList;
        this.substationList = substationList;
        this.voltageLevList = voltageLevList;
        this.faultTyList = faultTyList;
        this.degreeList = degreeList;
        this.groupList = groupList;
    }

    public MyListKeyAndVal getReYearList() {
        return reYearList;
    }

    public void setReYearList(MyListKeyAndVal reYearList) {
        this.reYearList = reYearList;
    }

    public MyListKeyAndVal getSupplierList() {
        return supplierList;
    }

    public void setSupplierList(MyListKeyAndVal supplierList) {
        this.supplierList = supplierList;
    }

    public MyListKeyAndVal getSubstationList() {
        return substationList;
    }

    public void setSubstationList(MyListKeyAndVal substationList) {
        this.substationList = substationList;
    }

    public MyListKeyAndVal getVoltageLevList() {
        return voltageLevList;
    }

    public void setVoltageLevList(MyListKeyAndVal voltageLevList) {
        this.voltageLevList = voltageLevList;
    }

    public MyListKeyAndVal getFaultTyList() {
        return faultTyList;
    }

    public void setFaultTyList(MyListKeyAndVal faultTyList) {
        this.faultTyList = faultTyList;
    }

    public MyListKeyAndVal getDegreeList() {
        return degreeList;
    }

    public void setDegreeList(MyListKeyAndVal degreeList) {
        this.degreeList = degreeList;
    }

    public MyListKeyAndVal getGroupList() {
        return groupList;
    }

    public void setGroupList(MyListKeyAndVal groupList) {
        this.groupList = groupList;
    }

}

class MyListKeyAndVal implements Serializable {
    private List<String> names;

    private List<Integer> values;

    public List<String> getNames() {
        return names;
    }

    public void setNames(List<String> names) {
        this.names = names;
    }

    public List<Integer> getValues() {
        return values;
    }

    public void setValues(List<Integer> values) {
        this.values = values;
    }

    public MyListKeyAndVal(List<String> names, List<Integer> values) {
        this.names = names;
        this.values = values;
    }
}